<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
        <meta name="format-detection" content="telephone=no">
        <meta charset="UTF-8">

        <meta name="description" content="Violate Responsive Admin Template">
        <meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">

        <title>视频管理</title>
            
        <!-- CSS -->
        <link href="${pageContext.request.contextPath}/admin/css/bootstrap.min.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/animate.min.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/font-awesome.min.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/form.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/calendar.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/media-player.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/style.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/icons.css" rel="stylesheet">
        <link href="${pageContext.request.contextPath}/admin/css/generics.css" rel="stylesheet"> 
         <script src="${pageContext.request.contextPath}/admin/assets/js/jquery.min.js"></script>
    </head>
    <body id="skin-blur-violate">
        <header id="header" class="media">
            <a href="" id="menu-toggle"></a> 
            <a class="logo pull-left" href="index.html">资源管理</a>
            
            <div class="media-body">
                <div class="media" id="top-menu">
                    
                    
                    

                    <div id="time" class="pull-right">
                        <span id="hours"></span>
                        :
                        <span id="min"></span>
                        :
                        <span id="sec"></span>
                    </div>

                    <div class="media-body">
                        <input type="text" class="main-search">
                    </div>
                </div>
            </div>
        </header>
        
        <div class="clearfix"></div>
        
        <section class="p-relative" role="main">
            
            <!-- Sidebar -->
            <aside id="sidebar">
                
                <!-- Sidbar Widgets -->
                <div class="side-widgets overflow">
                    <!-- Profile Menu -->
                    <div class="text-center s-widget m-b-25 dropdown" id="profile-menu">
                         <a href="" data-toggle="dropdown">
                            <img class="profile-pic animated" src="${pageContext.request.contextPath}/admin/img/1.jpg" alt="">
                        </a>
                         <ul class="dropdown-menu profile-menu">
                            <li><a href="${pageContext.request.contextPath}/music/listadmin">转到音乐播放界面</a> <i class="icon left">&#61903;</i><i class="icon right">&#61815;</i></li>
                            <li><a href="${pageContext.request.contextPath}/video/listadmin">转到视频播放界面</a> <i class="icon left">&#61903;</i><i class="icon right">&#61815;</i></li>     
                            <li><a href="${pageContext.request.contextPath}/system/user/login">退出登陆</a> <i class="icon left">&#61903;</i><i class="icon right">&#61815;</i></li>
                        </ul>
                        <h4 class="m-0">管理员</h4>
                    </div>
                    
                    <!-- Calendar -->
                    <div class="s-widget m-b-25">
                        <div id="sidebar-calendar"></div>
                    </div>
                   
                    
                   
                </div>
                
                <!-- Side Menu -->
                <ul class="list-unstyled side-menu">
                    <li>
                        <a class="sa-side-home" href="${pageContext.request.contextPath}/admin/index.jsp">
                            <span class="menu-item">主页</span>
                        </a>
                    </li>
                    <li>
                        <a class="sa-side-typography" href="${pageContext.request.contextPath}/music/list">
                            <span class="menu-item">音乐管理</span>
                        </a>
                    </li>
                    <li class="active">
                        <a class="sa-side-widget" href="${pageContext.request.contextPath}/video/list">
                            <span class="menu-item">视频管理</span>
                        </a>
                    </li>
                    <li>
                        <a class="sa-side-table" href="${pageContext.request.contextPath}/user/list">
                            <span class="menu-item">用户管理</span>
                        </a>
                    </li>
                    <li>
                        <a class="sa-side-folder" href="${pageContext.request.contextPath}/music/add">
                            <span class="menu-item">上传音乐</span>
                        </a>
                    </li>
                    <li>
                        <a class="sa-side-calendar" href="${pageContext.request.contextPath}/video/add">
                            <span class="menu-item">上传视频</span>
                        </a>
                    </li>
                </ul>
            </aside>
        
            <section id="content" class="container">
            
                
                
                 <!-- Breadcrumb -->
                <ol class="breadcrumb hidden-xs">
                    <li><a href="#">Home</a></li>
                    <li class="active">管理视频</li>
                </ol>
                
                <h4 class="page-title">TABLES</h4>

                
                <!--  <input type="file" name="file" class="btn btn-sm btn-alt m-r-5">
                 <input type="submit" value="提交" class="btn btn-sm m-r-5"> -->
                <!--  </form> -->
                
                                
                <!-- Deafult Table -->
                <div class="block-area" id="defaultStyle">
                    <h3 class="block-title">视频信息</h3>
 
                    
                    <table class="table tile">
                        <thead>
								<tr>
									<th>编号</th>
									<th>视频名</th>
									<!-- <th>上映时间</th> -->
									<th>操作</th>
								</tr>
							</thead>
                        <tbody>
                        <c:forEach items="${list }" var="m">
                            <tr>
                                <td>${m.id}</td>
                                <td>${m.videoName}</td>
                                <%-- <td>${m.singer}</td> --%>
                                <td>
	                                <a href="${pageContext.request.contextPath}/video/tovideoupdate?id=${m.id}" >修改</a>
									<%-- <a href="javascript:if(confirm('您确定要删除?')){window.location='${pageContext.request.contextPath}/music/musicdel?id=${m.id}&currentPage=${requestScope.page.currentPage}'}">
									 删除</a> --%>
							      <a data-toggle="modal" href="#modalNarrower">删除</a>
							      
							   <!--    <a href="">bofang </a> -->
							   </td>
                            </tr>
                            
                <!-- Modal Narrower -->	
                    <div class="modal fade" id="modalNarrower" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-sm">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title">提示！！</h4>
                                </div>
                                <div class="modal-body">
                                    <p>是否删除.</p>
                                </div>
                                <div class="modal-footer">
                                    <a type="button" class="btn btn-sm"  href="${pageContext.request.contextPath}/video/videodel?id=${m.id}">删除</a>
                                    <button type="button" class="btn btn-sm" data-dismiss="modal">Close</button>
                                </div>
                            </div>
                        </div>
                    </div>
               
                  </c:forEach>
                        </tbody>
                    </table>
                      共${requestScope.page.totalSize}条记录&nbsp;&nbsp;<span class="tooltip"></span>
               <div class="media text-center">
					<ul class="pagination">
						</a>
						</li>
						<li>${requestScope.pageString}
						</li>
						</a>
						</li>
					</ul>
				</div>
				
				
	<input type="hidden" value="${requestScope.page.totalPage}" id="totalPage"/> 
    <script type="text/javascript">
		$(document).ready(function(){
			$('.page_s').on('click',function(){
				var count=$(this).attr('lang');
				if(count <= parseInt($('#totalPage').val()) && count >= 1){
				window.location.href="${pageContext.request.contextPath}/video/list?currentPage="+count;
				}
			});
			
			
		});
	
	</script>
                    
                </div>
                 <div class="btn-group btn-group-justified m-b-10">
                        <a href="${pageContext.request.contextPath}/video/listadmin" class="btn btn-sm">转到视频播放器</a>
                        <a href="${pageContext.request.contextPath}/admin/uploadvideo.jsp" class="btn btn-sm">转到视频上传</a>
                    </div>
                
                
                
            </section>
        </section>
        
        <!-- Javascript Libraries -->
        <!-- jQuery -->
        <script src="${pageContext.request.contextPath}/admin/js/jquery.min.js"></script> <!-- jQuery Library -->
        <script src="${pageContext.request.contextPath}/admin/js/jquery-ui.min.js"></script> <!-- jQuery UI -->

        <!-- Bootstrap -->
        <script src="${pageContext.request.contextPath}/admin/js/bootstrap.min.js"></script>
        
        <!-- Form Related -->
        <script src="${pageContext.request.contextPath}/admin/js/select.min.js"></script> <!-- Custom Select -->
        <script src="${pageContext.request.contextPath}/admin/js/icheck.js"></script> <!-- Custom Checkbox + Radio -->
        
        <!-- Text Editor -->
        <script src="${pageContext.request.contextPath}/admin/js/editor.min.js"></script> <!-- WYSIWYG Editor -->
        
        <!-- Media -->
        <script src="${pageContext.request.contextPath}/admin/js/media-player.min.js"></script> <!-- Video Player -->
        
        <!-- UX -->
        <script src="${pageContext.request.contextPath}/admin/js/scroll.min.js"></script> <!-- Custom Scrollbar -->
        
        <!-- Other -->
        <script src="${pageContext.request.contextPath}/admin/js/calendar.min.js"></script> <!-- Calendar -->
        <script src="${pageContext.request.contextPath}/admin/js/feeds.min.js"></script> <!-- News Feeds -->
        
        
        
        <!-- All JS functions -->
        <script src="${pageContext.request.contextPath}/admin/js/functions.js"></script>
        
        <script type="text/javascript">
            $(document).ready(function() {
                
                //Calendar
                (function(){
                    var date = new Date();
                    var d = date.getDate();
                    var m = date.getMonth();
                    var y = date.getFullYear();
                    $('#calendar').fullCalendar({
                        header: {
                             center: '',
                             right: 'prev, next',
                             left: 'title'
                        },
    
                        selectable: true,
                        selectHelper: true,
                        editable: true,
                        events: [
                            {
                                title: 'Hangout with friends',
                                start: new Date(y, m, 1),
                                end: new Date(y, m, 2)
                            },
                            {
                                title: 'Meeting with client',
                                start: new Date(y, m, 10),
                                allDay: true
                            },
                            {
                                title: 'Repeat Event',
                                start: new Date(y, m, 18),
                                allDay: true
                            },
                            {
                                title: 'Semester Exam',
                                start: new Date(y, m, 20),
                                end: new Date(y, m, 23)
                            },
                            {
                                title: 'Soccor match',
                                start: new Date(y, m, 5),
                                end: new Date(y, m, 6)
                            },
                            {
                                title: 'Coffee time',
                                start: new Date(y, m, 21),
                            },
                            {
                                title: 'Job Interview',
                                start: new Date(y, m, 5),
                            }
                        ],
                         
                        //On Day Select
                        select: function(start, end, allDay) {
                            $('#addNew-event').modal('show');   
                            $('#addNew-event input:text').val('');
                            $('#getStart').val(start);
                            $('#getEnd').val(end);
                        },
                         
                        eventResize: function(event,dayDelta,minuteDelta,revertFunc) {
                            $('#editEvent').modal('show');
    
                            var info =
                                "The end date of " + event.title + "has been moved " +
                                dayDelta + " days and " +
                                minuteDelta + " minutes."
                            ;
                            
                            $('#eventInfo').html(info);
                    
                    
                            $('#editEvent #editCancel').click(function(){
                                 revertFunc();
                            }) 
                        }
                    });
                    
                    $('body').on('click', '#addEvent', function(){
                         var eventForm =  $(this).closest('.modal').find('.form-validation');
                         eventForm.validationEngine('validate');
                         
                         if (!(eventForm).find('.formErrorContent')[0]) {
                              
                              //Event Name
                              var eventName = $('#eventName').val();
    
                              //Render Event
                              $('#calendar').fullCalendar('renderEvent',{
                                   title: eventName,
                                   start: $('#getStart').val(),
                                   end:  $('#getEnd').val(),
                                   allDay: true,
                              },true ); //Stick the event
                              
                              $('#addNew-event form')[0].reset()
                              $('#addNew-event').modal('hide');
                         } 
                    });
                    
                    //Calendar views
                    $('body').on('click', '.calendar-actions > li > a', function(e){
                        e.preventDefault();
                        var dataView = $(this).attr('data-view');
                        $('#calendar').fullCalendar('changeView', dataView);
                        
                        //Custom scrollbar
                        var overflowRegular, overflowInvisible = false;
                        overflowRegular = $('.overflow').niceScroll();     
                    });      
                })();
            });    
            
                          
            
       </script>
    </body>
</html>

